package EjemplosStreamBytes;

import java.io.*;

class MiClase implements Serializable {
}

public class StreamsBytes{
	public static void main(String[] args) {
		MiClase m = new MiClase();
		try {
			FileOutputStream a = new FileOutputStream("testSer.ser");
			ObjectOutputStream b = new ObjectOutputStream(a);
			b.writeObject(m);
			b.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		try {
			FileInputStream d = new FileInputStream("testSer.ser");
			ObjectInputStream f = new ObjectInputStream(d);
			m = (MiClase) f.readObject();
			System.out.println(m.toString());
			f.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
